package cn.shop.dys.util;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Created by clannad on 2016/4/18.
 */
public class CategoryNoScrollGridView extends GridView {
    public CategoryNoScrollGridView(Context context) {
        super(context);
    }

    public CategoryNoScrollGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CategoryNoScrollGridView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    /**
     *   设置不能滚动
     * @param widthMeasureSpec
     * @param heightMeasureSpec
     */
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int spec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, spec);


    }
}
